package cn.summit.web.service.impl;


import cn.summit.web.entity.SysPermission;
import cn.summit.web.mapper.SysPermissionMapper;
import cn.summit.web.service.SysPermissionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author summit
 * @since 2020/3/7 22:39
 */
@Service
public class SysPermissionServiceImpl extends
    ServiceImpl<SysPermissionMapper, SysPermission> implements SysPermissionService {


    @Override
    public List<SysPermission> findByUserId(Long userId) {
        if (userId == null) {
            return null;
        }
        List<SysPermission> permissionList = baseMapper.selectPermissionByUserId(userId);
        // 如果没有权限，则将集合中的数据null移除
        //        permissionList.remove(null);
        return permissionList;
    }

}
